#include <stdio.h>

int main()
{
    int max1, max2, min1, min2,sum, num1, num2,differ;
    int scores[10] = {};
    double total, average;
    max1 = -32768;
    max2 = -32768;
    min1= 32767;
    min2=-32768;
    for (int i = 0; i < 10; i++)
    {
        printf("Input number %d=", i);
        scanf("%d", &scores[i]);
        if (scores[i] > max1)
            max1 = scores[i];
        if (scores[i] < min1)
            min1= scores[i];
        total += scores[i];
    }
    printf("%f\n", total);
    average = (double)(total - max1 - min1) / 8;
    for (int i = 0; i < 10; i++)
    {
        differ = scores[i] - average;
        if (differ < 0)
            differ *= -1;
        if (differ > max2)
        {
            max2 = differ;
            num1= i + 1;
        }
        if(differ<min2){
            min2=differ;
            num2=i+1;
        }
    }
    printf("Canceled max score:%d\nCanceled min score:%d\n", max1, min1);
    printf("Average score:%f\n", average);
    printf("%d is the worst judge\n", num1);
    printf("%d is the fairest judge\n",num2);
}